package com.zfei.gfb.api;

import com.zfei.gfb.api.domain.*;
import com.zfei.gfb.bean.StatusException;

import java.util.List;
import java.util.Set;

/**
 * 说吧服务
 *
 * @author fgh
 */
public interface TalkService {

    /**
     * 创建事件
     *
     * @param event 事件
     * @return 事件元组
     */
    EventTuple createEvent(TalkEvent event) throws StatusException;

    /**
     * 删除事件
     *
     * @param eventId 事件ID
     * @return 事件ID
     */
    String deleteEvent(String eventId) throws StatusException;

    /**
     * 删除事件
     *
     * @param update 更新
     * @return 事件ID
     */
    String deleteEvent(Update update) throws StatusException;

    /**
     * 恢复事件
     *
     * @param eventId 事件ID
     * @return 事件ID
     */
    String recoveryEvent(String eventId) throws StatusException;

    /**
     * 恢复事件
     *
     * @param update 更新
     * @return 事件ID
     */
    String recoveryEvent(Update update) throws StatusException;


    /**
     * 获取事件
     *
     * @param eventId 事件ID
     * @return 事件
     */
    TalkEvent getEvent(String eventId) throws StatusException;

    /**
     * 批量获取事件
     *
     * @param eventIds 事件ID列表
     * @return 事件列表
     */
    List<TalkEvent> getEvent(List<String> eventIds) throws StatusException;

    /**
     * 浏览单条时间线的事件
     *
     * @param eventId 时间线
     * @param page    分页
     * @return 事件列表
     */
    List<TalkEvent> listEvent(String eventId, Page page) throws StatusException;

    List<KeyTuple> listKeyEvent(String inboxName, long maxTime, int count) throws StatusException;

    /**
     * 浏览多条时间线的事件
     *
     * @param inboxNames 时间线集合
     * @param maxTime    最大时间
     * @param count      数量
     * @return 事件列表
     */
    List<TalkEvent> listEvent(Set<String> inboxNames, long maxTime, int count) throws StatusException;


    TalkEvent getClaim(String userId, String parent) throws StatusException;

    TalkEvent getBrowse(String userId, String parent) throws StatusException;

    List<TalkEvent> getClaim(String userId, Set<String> parents) throws StatusException;

    List<TalkEvent> getBrowse(String userId, Set<String> parents) throws StatusException;

    TalkEvent getCollect(String userId, String eventId) throws StatusException;

    List<TalkEvent> getCollect(String userId, Set<String> eventIds) throws StatusException;

    List<TalkEvent> listBrowse(String eventId, Page page) throws StatusException;

    List<TalkEvent> listCollect(String phone, Page page) throws StatusException;

    List<TalkEvent> listClain(String identifierId, Page page) throws StatusException;

    List<TalkEvent> listComment(String phone, Page page) throws StatusException;

    List<TalkEvent> listMyComment(String userId, Page page) throws StatusException;

    void updatePrivilege(List<String> eventIds, Integer privilege);

    void updateReply(List<String> eventIds);
}
